package com.mkx.controller;

import com.mkx.service.FirstCaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * First Case RESTful Controller
 * 提供HTTP接口，供外部系统调用
 */
@RestController
public class FirstCaseController {

    @Autowired
    private FirstCaseService firstCaseService;

    /**
     * RESTful接口：获取服务信息
     * @param param 请求参数
     * @return 服务响应结果
     */
    @GetMapping("/api/first-case/info")
    public String getServiceInfo(@RequestParam String param) {
        return firstCaseService.getServiceInfo(param);
    }

    /**
     * RESTful接口：处理业务逻辑
     * @param id 业务ID
     * @return 处理结果
     */
    @GetMapping("/api/first-case/process/{id}")
    public String processBusiness(@PathVariable Long id) {
        return firstCaseService.processBusiness(id);
    }
}